#import "JokeModel.h"

@implementation JokeModel

@synthesize jokeIndex, jokeId, jokeTime, jokeText, jokeImgUrl, jokeGifData, jokeImgFull, jokeImgThumbnail, goodNum, badNum, replyNum, userId, userName, userIconUrl, read, liked, unliked, replies, replyRequestTime;

- (id)init {
    self = [super init];
    if (self) {
        jokeIndex = NSIntegerMax;
        read = NO;
        liked = -1;
        unliked = -1;
        jokeGifData = nil;
        jokeImgFull = nil;
        jokeImgThumbnail = nil;
        replies = [[NSMutableArray alloc] init];
        replyRequestTime = 0;
    }
    return self;
}

- (id)copyWithZone:(NSZone *)zone {
    JokeModel *copy = [[[self class] allocWithZone: zone] init];
    copy.jokeIndex = self.jokeIndex;
    copy.jokeId = self.jokeId;
    copy.jokeText = self.jokeText;
    copy.jokeTime = self.jokeTime;
    copy.jokeImgUrl = self.jokeImgUrl;
    copy.goodNum = self.goodNum;
    copy.badNum = self.badNum;
    copy.replyNum = self.replyNum;
    copy.userId = self.userId;
    copy.userName = self.userName;
    copy.userIconUrl = self.userIconUrl;
    copy.read = self.read;
    copy.liked = self.liked;
    copy.unliked = self.unliked;
    copy.replyRequestTime = self.replyRequestTime;
    return copy;
}

-(void)dealloc {
    [jokeId release]; jokeId = nil;
    [jokeGifData release]; jokeGifData = nil;
    [jokeImgFull release]; jokeImgFull = nil;
    [jokeImgThumbnail release]; jokeImgThumbnail = nil;
    [replies release]; replies = nil;
    [jokeTime release]; jokeTime = nil;
    [jokeText release]; jokeText = nil;
    [jokeImgUrl release]; jokeImgUrl = nil;
    [userName release]; userName = nil;
    [userIconUrl release]; userIconUrl = nil;
    [super dealloc];
}

@end
